package Be_greedy_for_snakes;

import java.util.Random;

public class Node {
    private int x;
    private int y;

    public Node() {
    }

    public Node(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void random(){             //随机位置生成方法
        Random r = new Random();      //创建一个随机对象
        this.x = r.nextInt(50);//定义横坐标
        this.y = r.nextInt(35);//定义纵坐标
    }
}
